package com.project.bean;

import javax.validation.constraints.*;

public class UserBean {
    private int id;
    @NotBlank(groups = {ValidateAdd.class},message = "用户名必须填写")
    private String userName;
    @Pattern(groups = {ValidateAdd.class,ValidateUpdate.class},
            regexp = "[a-zA-Z0-9]{6}",message = "密码必须6位字母或数字")
    private String pwd;
    @Min(groups = {ValidateAdd.class},value = 2000,message = "黑心老板2000都不给？")
    @Max(groups = {ValidateAdd.class},value = 10000,message = "你要让我破产啊？")
    private Integer money;
    @NotBlank(groups = {ValidateAdd.class},message = "邮箱必须填写")
    @Email(groups = {ValidateAdd.class},message = "邮箱格式为XX@XX.com")
    private String email;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", pwd='" + pwd + '\'' +
                ", money=" + money +
                ", email='" + email + '\'' +
                '}';
    }
}
